﻿using UnityEngine;
using System;
using System.Collections;

public class ClimbableTrigger : TriggerBase
{
    /*[SerializeField] private bool m_Climbable;

    //面朝下是0度，面朝左是90度，面朝上是180度，面朝右是270度
    [SerializeField] private float m_Angle;

    private MyEventArgs m_climbeEventArgs;

    public bool Climbable
    {
        get
        {
            return m_Climbable;
        }
        set
        {
            m_Climbable = value;
        }
    }*/

    public void OnTriggerEnter(Collider col)
    {
        if (col.tag == string.Intern("Hero"))
        {
            EventMgr.InvokeEvent(GameTypeDefine.EVENT_ID.CLIMBE_TRIGGER_IN_EVENT, new InteractEventArgs(this.gameObject, col.gameObject));
        }
    }

    /*public void NoticeEnter(object sender, GameObject gameSender){
        if (m_Climbable) {
            switch (sender.GetType ().Name) {
            case "PlayerCharacter":
                gameSender.GetComponent<PlayerCharacter>().ControlState=(PlayerCharacter.CONTROL_STATE)1;
                gameSender.GetComponent<PlayerCharacter>().SetClimbeParam( (transform.parent.transform.position.y+transform.parent.transform.localScale.y/2-gameSender.transform.position.y+gameSender.transform.localScale.y/2), 
                                                                          Mathf.Sin (Mathf.Deg2Rad*m_Angle),
                                                                          Mathf.Cos (Mathf.Deg2Rad*m_Angle));
                //m_UIMgr.ShowTipButton("K","攀爬");
                break;
            default:
                break;
            }
        }
    }

    public void NoticeExit(object sender, GameObject gameSender){
        if(m_Climbable){
            switch (sender.GetType ().Name){
            case "PlayerCharacter":
                //m_UIMgr.HideTipButton();
                break;
            default:
                break;
            }
        }
    }*/
}
